<?php
/**
 * Created by PhpStorm.
 * User: Amitav Roy
 * Date: 18/11/14
 * Time: 11:58 AM
 */

class GlobalController extends BaseController {

    protected $layout;

    public function __construct()
    {
        /**
         * Checking for the master tpl
         */
        $masterTpl = getCustomerConfig('master-tpl');
        if ($masterTpl != '')
            $this->layout = $masterTpl;
        else
            $this->layout = 'administer::masters.html';
    }

    public function setLayout($layoutName = null)
    {
        if ($layoutName == null)
            App::abort(500, 'Layout name needs to be passed.');

        $this->layout = $layoutName;
    }
}